document.getElementById('searchForm').addEventListener('submit', function(event) {
    event.preventDefault(); // 阻止表单的默认提交行为
    var searchWord = encodeURIComponent(document.getElementById('word').value);
    var url = '/search?word=' + searchWord; // 构建带有编码参数的URL
    window.location.href = url; // 导航至新的URL
});
